package com.example.demospring5.primary.prime;

/**
 * Java基本空值反转
 *
 * @Author ifredomvip@gmail.com
 * @Date 2022/7/29 14:47
 * @Version 1.0.0
 * @Description
 **/
public class NativeIocContainer {
    public static void main(String[] args) throws Exception {
        // 普通创建对象
        NativeModuleA nativeModuleA = new NativeModuleA();
        nativeModuleA.callModule();

        // 使用容器创建对象
        IocContainer<NativeModuleA> iocContainer = new IocContainer<>(NativeModuleA.class);
        NativeModuleA moduleA = (NativeModuleA) iocContainer.getNativeModule();
        moduleA.callModule();

        // 使用容器创建对象
        IocContainer<NativeModuleB> iocContainer2 = new IocContainer<>(NativeModuleB.class);
        NativeModuleB moduleB = iocContainer2.getNativeModule(NativeModuleB.class);
        moduleB.callModule();
    }
}
